/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.model;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author gianmariospacagna
 */
@Entity
public class CurrencyRate2 implements CurrencyRateDTO,Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private CurrencyRateKey myKey;
    private float rate;

    public CurrencyRate2(){
        
    }

    public CurrencyRate2(String id, String id0){
        myKey=new CurrencyRateKey(id,id0);
        
    }
    
    

    @Override
    public float getRate() {
        return rate;
    }

    public void setRate(float rate) {
        this.rate = rate;
    }

      
    
    
    

    

    @Override
    public int hashCode() {
        return myKey.hashCode();
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        
        
        
        return myKey.equals(object);
    }

    @Override
    public String toString() {
        return myKey.toString();
    }

    @Override
    public CurrencyRateKey getKey() {
        return this.myKey;
    }

    
    
}
